3.45 \(\int \sqrt{a+a \sec (e+f x)} (c-c \sec (e+f x)) \, dx\)

Optimal. Leaf size=66 \[ \frac{2 \sqrt{a} c \tan ^{-1}\left (\frac{\sqrt{a} \tan (e+f x)}{\sqrt{a \sec (e+f x)+a}}\right )}{f}-\frac{2 a c \tan (e+f x)}{f \sqrt{a \sec (e+f x)+a}} \]

[Out]

(2*Sqrt[a]*c*ArcTan[(Sqrt[a]*Tan[e + f*x])/Sqrt[a + a*Sec[e + f*x]]])/f - (2*a*c*Tan[e + f*x])/(f*Sqrt[a + a*S
ec[e + f*x]])

________________________________________________________________________________________

Rubi [A]  time = 0.109402, antiderivative size = 66, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.154, Rules used = {3904, 3887, 321, 203} \[ \frac{2 \sqrt{a} c \tan ^{-1}\left (\frac{\sqrt{a} \tan (e+f x)}{\sqrt{a \sec (e+f x)+a}}\right )}{f}-\frac{2 a c \tan (e+f x)}{f \sqrt{a \sec (e+f x)+a}} \]

Antiderivative was successfully verified.

[In]

Int[Sqrt[a + a*Sec[e + f*x]]*(c - c*Sec[e + f*x]),x]

[Out]

(2*Sqrt[a]*c*ArcTan[(Sqrt[a]*Tan[e + f*x])/Sqrt[a + a*Sec[e + f*x]]])/f - (2*a*c*Tan[e + f*x])/(f*Sqrt[a + a*S
ec[e + f*x]])

Rule 3904

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.)*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_))^(n_.), x_Symbol] :> Di
st[(-(a*c))^m, Int[Cot[e + f*x]^(2*m)*(c + d*Csc[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x]
&& EqQ[b*c + a*d, 0] && EqQ[a^2 - b^2, 0] && IntegerQ[m] && RationalQ[n] &&  !(IntegerQ[n] && GtQ[m - n, 0])

Rule 3887

Int[cot[(c_.) + (d_.)*(x_)]^(m_.)*(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_.), x_Symbol] :> Dist[(-2*a^(m/2 +
 n + 1/2))/d, Subst[Int[(x^m*(2 + a*x^2)^(m/2 + n - 1/2))/(1 + a*x^2), x], x, Cot[c + d*x]/Sqrt[a + b*Csc[c +
d*x]]], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0] && IntegerQ[m/2] && IntegerQ[n - 1/2]

Rule 321

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^n
)^(p + 1))/(b*(m + n*p + 1)), x] - Dist[(a*c^n*(m - n + 1))/(b*(m + n*p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \sqrt{a+a \sec (e+f x)} (c-c \sec (e+f x)) \, dx &=-\left ((a c) \int \frac{\tan ^2(e+f x)}{\sqrt{a+a \sec (e+f x)}} \, dx\right )\\ &=\frac{\left (2 a^2 c\right ) \operatorname{Subst}\left (\int \frac{x^2}{1+a x^2} \, dx,x,-\frac{\tan (e+f x)}{\sqrt{a+a \sec (e+f x)}}\right )}{f}\\ &=-\frac{2 a c \tan (e+f x)}{f \sqrt{a+a \sec (e+f x)}}-\frac{(2 a c) \operatorname{Subst}\left (\int \frac{1}{1+a x^2} \, dx,x,-\frac{\tan (e+f x)}{\sqrt{a+a \sec (e+f x)}}\right )}{f}\\ &=\frac{2 \sqrt{a} c \tan ^{-1}\left (\frac{\sqrt{a} \tan (e+f x)}{\sqrt{a+a \sec (e+f x)}}\right )}{f}-\frac{2 a c \tan (e+f x)}{f \sqrt{a+a \sec (e+f x)}}\\ \end{align*}

Mathematica [A]  time = 0.320407, size = 70, normalized size = 1.06 \[ -\frac{2 c \tan \left (\frac{1}{2} (e+f x)\right ) \sqrt{a (\sec (e+f x)+1)} \left (\sqrt{\sec (e+f x)-1}-\tan ^{-1}\left (\sqrt{\sec (e+f x)-1}\right )\right )}{f \sqrt{\sec (e+f x)-1}} \]

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[a + a*Sec[e + f*x]]*(c - c*Sec[e + f*x]),x]

[Out]

(-2*c*(-ArcTan[Sqrt[-1 + Sec[e + f*x]]] + Sqrt[-1 + Sec[e + f*x]])*Sqrt[a*(1 + Sec[e + f*x])]*Tan[(e + f*x)/2]
)/(f*Sqrt[-1 + Sec[e + f*x]])

________________________________________________________________________________________

Maple [A]  time = 0.212, size = 115, normalized size = 1.7 \begin{align*} -{\frac{c}{f\sin \left ( fx+e \right ) }\sqrt{{\frac{a \left ( 1+\cos \left ( fx+e \right ) \right ) }{\cos \left ( fx+e \right ) }}} \left ( \sqrt{2}\sin \left ( fx+e \right ){\it Artanh} \left ({\frac{\sqrt{2}\sin \left ( fx+e \right ) }{2\,\cos \left ( fx+e \right ) }\sqrt{-2\,{\frac{\cos \left ( fx+e \right ) }{1+\cos \left ( fx+e \right ) }}}} \right ) \sqrt{-2\,{\frac{\cos \left ( fx+e \right ) }{1+\cos \left ( fx+e \right ) }}}-2\,\cos \left ( fx+e \right ) +2 \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c-c*sec(f*x+e))*(a+a*sec(f*x+e))^(1/2),x)

[Out]

-c/f*(1/cos(f*x+e)*a*(1+cos(f*x+e)))^(1/2)*(2^(1/2)*sin(f*x+e)*arctanh(1/2*2^(1/2)*(-2*cos(f*x+e)/(1+cos(f*x+e
)))^(1/2)*sin(f*x+e)/cos(f*x+e))*(-2*cos(f*x+e)/(1+cos(f*x+e)))^(1/2)-2*cos(f*x+e)+2)/sin(f*x+e)

________________________________________________________________________________________

Maxima [B]  time = 1.71311, size = 198, normalized size = 3. \begin{align*} \frac{\sqrt{a} c \arctan \left ({\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac{1}{4}} \sin \left (\frac{1}{2} \, \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) + \sin \left (f x + e\right ),{\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac{1}{4}} \cos \left (\frac{1}{2} \, \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) + \cos \left (f x + e\right )\right )}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c-c*sec(f*x+e))*(a+a*sec(f*x+e))^(1/2),x, algorithm="maxima")

[Out]

sqrt(a)*c*arctan2((cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/4)*sin(1/2*arctan2(sin
(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)) + sin(f*x + e), (cos(2*f*x + 2*e)^2 + sin(2*f*x + 2*e)^2 + 2*cos(2*f*x +
 2*e) + 1)^(1/4)*cos(1/2*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)) + cos(f*x + e))/f

________________________________________________________________________________________

Fricas [A]  time = 1.14571, size = 620, normalized size = 9.39 \begin{align*} \left [\frac{{\left (c \cos \left (f x + e\right ) + c\right )} \sqrt{-a} \log \left (\frac{2 \, a \cos \left (f x + e\right )^{2} - 2 \, \sqrt{-a} \sqrt{\frac{a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + a \cos \left (f x + e\right ) - a}{\cos \left (f x + e\right ) + 1}\right ) - 2 \, c \sqrt{\frac{a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right )}{f \cos \left (f x + e\right ) + f}, -\frac{2 \,{\left ({\left (c \cos \left (f x + e\right ) + c\right )} \sqrt{a} \arctan \left (\frac{\sqrt{\frac{a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt{a} \sin \left (f x + e\right )}\right ) + c \sqrt{\frac{a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \sin \left (f x + e\right )\right )}}{f \cos \left (f x + e\right ) + f}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c-c*sec(f*x+e))*(a+a*sec(f*x+e))^(1/2),x, algorithm="fricas")

[Out]

[((c*cos(f*x + e) + c)*sqrt(-a)*log((2*a*cos(f*x + e)^2 - 2*sqrt(-a)*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*c
os(f*x + e)*sin(f*x + e) + a*cos(f*x + e) - a)/(cos(f*x + e) + 1)) - 2*c*sqrt((a*cos(f*x + e) + a)/cos(f*x + e
))*sin(f*x + e))/(f*cos(f*x + e) + f), -2*((c*cos(f*x + e) + c)*sqrt(a)*arctan(sqrt((a*cos(f*x + e) + a)/cos(f
*x + e))*cos(f*x + e)/(sqrt(a)*sin(f*x + e))) + c*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*sin(f*x + e))/(f*cos
(f*x + e) + f)]

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} - c \left (\int \sqrt{a \sec{\left (e + f x \right )} + a} \sec{\left (e + f x \right )}\, dx + \int - \sqrt{a \sec{\left (e + f x \right )} + a}\, dx\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c-c*sec(f*x+e))*(a+a*sec(f*x+e))**(1/2),x)

[Out]

-c*(Integral(sqrt(a*sec(e + f*x) + a)*sec(e + f*x), x) + Integral(-sqrt(a*sec(e + f*x) + a), x))

________________________________________________________________________________________

Giac [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c-c*sec(f*x+e))*(a+a*sec(f*x+e))^(1/2),x, algorithm="giac")

[Out]

Timed out